package com.pannadchen.web;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;

public class UrlEncodeTool {
	public static void main(String args[]) throws UnsupportedEncodingException{
		String content="\n";
//		String content="【DA】";
//		String content="DA的短信报警\n中文测试{Test=123?}";
		System.out.println(content);
		
		String encoded=URLEncoder.encode(content, "utf-8");
		System.out.println("Encoded:");
		System.out.println(encoded);
		
		String decoded=URLDecoder.decode(encoded, "utf-8");
		System.out.println("Decoded:");
		System.out.println(decoded);
	}
}
